<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>tennisScore</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th bgcolor="#70b0f0" class="navbar-select"
          >&nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            >tennisScore</th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        Module&nbsp;tennisScore
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="tennisScore-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="tennisScore-module.html">Module tennisScore</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno">  1</tt>  <tt class="py-line"><tt class="py-comment">#!/usr/bin/python</tt> </tt>
<a name="L2"></a><tt class="py-lineno">  2</tt>  <tt class="py-line"> </tt>
<a name="L3"></a><tt class="py-lineno">  3</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L4"></a><tt class="py-lineno">  4</tt>  <tt class="py-line"><tt class="py-docstring">tennisScore.py</tt> </tt>
<a name="L5"></a><tt class="py-lineno">  5</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L6"></a><tt class="py-lineno">  6</tt>  <tt class="py-line"><tt class="py-docstring">Copyright 2014, Ty A. Lasky</tt> </tt>
<a name="L7"></a><tt class="py-lineno">  7</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L8"></a><tt class="py-lineno">  8</tt>  <tt class="py-line"><tt class="py-docstring">Released under the GNU General Public License 3.0</tt> </tt>
<a name="L9"></a><tt class="py-lineno">  9</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L10"></a><tt class="py-lineno"> 10</tt>  <tt class="py-line"><tt class="py-docstring">See LICENSE.txt for license information.</tt> </tt>
<a name="L11"></a><tt class="py-lineno"> 11</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L12"></a><tt class="py-lineno"> 12</tt>  <tt class="py-line"><tt class="py-docstring">---------------------------------------------------</tt> </tt>
<a name="L13"></a><tt class="py-lineno"> 13</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L14"></a><tt class="py-lineno"> 14</tt>  <tt class="py-line"><tt class="py-docstring">Main program (controller) for tennis scoreboard based on model, view, controller architecture.</tt> </tt>
<a name="L15"></a><tt class="py-lineno"> 15</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L16"></a><tt class="py-lineno"> 16</tt>  <tt class="py-line"><tt class="py-docstring">Exported classes:</tt> </tt>
<a name="L17"></a><tt class="py-lineno"> 17</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L18"></a><tt class="py-lineno"> 18</tt>  <tt class="py-line"><tt class="py-docstring">Controller -- The controller for a tennis scoreboard program.</tt> </tt>
<a name="L19"></a><tt class="py-lineno"> 19</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L20"></a><tt class="py-lineno"> 20</tt>  <tt class="py-line"> </tt>
<a name="L21"></a><tt class="py-lineno"> 21</tt>  <tt class="py-line"><tt id="link-0" class="py-name" targets="Variable playerError.py=playerError-module.html#py,Variable scoring.py=scoring-module.html#py,Variable setup1.py=setup1-module.html#py,Variable setup2.py=setup2-module.html#py,Variable setup3.py=setup3-module.html#py,Variable tennisScore.py=tennisScore-module.html#py,Variable tennisView.py=tennisView-module.html#py,Variable util.py=util-module.html#py"><a title="playerError.py
scoring.py
setup1.py
setup2.py
setup3.py
tennisScore.py
tennisView.py
util.py" class="py-name" href="#" onclick="return doclink('link-0', 'py', 'link-0');">py</a></tt> <tt class="py-op">=</tt> <tt class="py-number">2</tt> </tt>
<a name="L22"></a><tt class="py-lineno"> 22</tt>  <tt class="py-line"><tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L23"></a><tt class="py-lineno"> 23</tt>  <tt class="py-line">        <tt class="py-keyword">import</tt> <tt class="py-name">Tkinter</tt> <tt class="py-keyword">as</tt> <tt class="py-name">tk</tt> </tt>
<a name="L24"></a><tt class="py-lineno"> 24</tt>  <tt class="py-line"><tt class="py-keyword">except</tt><tt class="py-op">:</tt> </tt>
<a name="L25"></a><tt class="py-lineno"> 25</tt>  <tt class="py-line">        <tt class="py-keyword">import</tt> <tt class="py-name">tkinter</tt> <tt class="py-keyword">as</tt> <tt class="py-name">tk</tt> </tt>
<a name="L26"></a><tt class="py-lineno"> 26</tt>  <tt class="py-line">        <tt id="link-1" class="py-name"><a title="playerError.py
scoring.py
setup1.py
setup2.py
setup3.py
tennisScore.py
tennisView.py
util.py" class="py-name" href="#" onclick="return doclink('link-1', 'py', 'link-0');">py</a></tt> <tt class="py-op">=</tt> <tt class="py-number">3</tt> </tt>
<a name="L27"></a><tt class="py-lineno"> 27</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-2" class="py-name" targets="Module tennisModel=tennisModel-module.html"><a title="tennisModel" class="py-name" href="#" onclick="return doclink('link-2', 'tennisModel', 'link-2');">tennisModel</a></tt> <tt class="py-keyword">import</tt> <tt id="link-3" class="py-name" targets="Class tennisModel.Model=tennisModel.Model-class.html"><a title="tennisModel.Model" class="py-name" href="#" onclick="return doclink('link-3', 'Model', 'link-3');">Model</a></tt> </tt>
<a name="L28"></a><tt class="py-lineno"> 28</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-4" class="py-name" targets="Module tennisView=tennisView-module.html"><a title="tennisView" class="py-name" href="#" onclick="return doclink('link-4', 'tennisView', 'link-4');">tennisView</a></tt> <tt class="py-keyword">import</tt> <tt id="link-5" class="py-name" targets="Class tennisView.View=tennisView.View-class.html"><a title="tennisView.View" class="py-name" href="#" onclick="return doclink('link-5', 'View', 'link-5');">View</a></tt> </tt>
<a name="L29"></a><tt class="py-lineno"> 29</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-6" class="py-name" targets="Module setup1=setup1-module.html"><a title="setup1" class="py-name" href="#" onclick="return doclink('link-6', 'setup1', 'link-6');">setup1</a></tt> <tt class="py-keyword">import</tt> <tt id="link-7" class="py-name" targets="Class setup1.Setup1=setup1.Setup1-class.html"><a title="setup1.Setup1" class="py-name" href="#" onclick="return doclink('link-7', 'Setup1', 'link-7');">Setup1</a></tt> </tt>
<a name="L30"></a><tt class="py-lineno"> 30</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-8" class="py-name" targets="Module setup2=setup2-module.html,Method tennisScore.Controller.setup2()=tennisScore.Controller-class.html#setup2"><a title="setup2
tennisScore.Controller.setup2" class="py-name" href="#" onclick="return doclink('link-8', 'setup2', 'link-8');">setup2</a></tt> <tt class="py-keyword">import</tt> <tt id="link-9" class="py-name" targets="Class setup2.Setup2=setup2.Setup2-class.html"><a title="setup2.Setup2" class="py-name" href="#" onclick="return doclink('link-9', 'Setup2', 'link-9');">Setup2</a></tt> </tt>
<a name="L31"></a><tt class="py-lineno"> 31</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-10" class="py-name" targets="Module setup3=setup3-module.html"><a title="setup3" class="py-name" href="#" onclick="return doclink('link-10', 'setup3', 'link-10');">setup3</a></tt> <tt class="py-keyword">import</tt> <tt id="link-11" class="py-name" targets="Class setup3.Setup3=setup3.Setup3-class.html"><a title="setup3.Setup3" class="py-name" href="#" onclick="return doclink('link-11', 'Setup3', 'link-11');">Setup3</a></tt> </tt>
<a name="L32"></a><tt class="py-lineno"> 32</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-12" class="py-name" targets="Module playerError=playerError-module.html"><a title="playerError" class="py-name" href="#" onclick="return doclink('link-12', 'playerError', 'link-12');">playerError</a></tt> <tt class="py-keyword">import</tt> <tt id="link-13" class="py-name" targets="Class playerError.PlayerError=playerError.PlayerError-class.html"><a title="playerError.PlayerError" class="py-name" href="#" onclick="return doclink('link-13', 'PlayerError', 'link-13');">PlayerError</a></tt> </tt>
<a name="L33"></a><tt class="py-lineno"> 33</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-14" class="py-name" targets="Module scoring=scoring-module.html"><a title="scoring" class="py-name" href="#" onclick="return doclink('link-14', 'scoring', 'link-14');">scoring</a></tt> <tt class="py-keyword">import</tt> <tt id="link-15" class="py-name" targets="Class scoring.Scoring=scoring.Scoring-class.html"><a title="scoring.Scoring" class="py-name" href="#" onclick="return doclink('link-15', 'Scoring', 'link-15');">Scoring</a></tt> </tt>
<a name="L34"></a><tt class="py-lineno"> 34</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">random</tt> <tt class="py-keyword">import</tt> <tt class="py-name">randrange</tt> </tt>
<a name="L35"></a><tt class="py-lineno"> 35</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt id="link-16" class="py-name" targets="Module player=player-module.html"><a title="player" class="py-name" href="#" onclick="return doclink('link-16', 'player', 'link-16');">player</a></tt> </tt>
<a name="L36"></a><tt class="py-lineno"> 36</tt>  <tt class="py-line"> </tt>
<a name="L37"></a><tt class="py-lineno"> 37</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">sys</tt> </tt>
<a name="L38"></a><tt class="py-lineno"> 38</tt>  <tt class="py-line"><tt class="py-name">sys</tt><tt class="py-op">.</tt><tt class="py-name">path</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-string">'../lib'</tt><tt class="py-op">)</tt> </tt>
<a name="L39"></a><tt class="py-lineno"> 39</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt id="link-17" class="py-name" targets="Module util=util-module.html"><a title="util" class="py-name" href="#" onclick="return doclink('link-17', 'util', 'link-17');">util</a></tt> </tt>
<a name="L40"></a><tt class="py-lineno"> 40</tt>  <tt class="py-line"> </tt>
<a name="L41"></a><tt class="py-lineno"> 41</tt>  <tt class="py-line"><tt id="link-18" class="py-name" targets="Variable tennisModel.DEBUG=tennisModel-module.html#DEBUG,Variable tennisScore.DEBUG=tennisScore-module.html#DEBUG,Variable tennisView.DEBUG=tennisView-module.html#DEBUG"><a title="tennisModel.DEBUG
tennisScore.DEBUG
tennisView.DEBUG" class="py-name" href="#" onclick="return doclink('link-18', 'DEBUG', 'link-18');">DEBUG</a></tt> <tt class="py-op">=</tt> <tt class="py-name">False</tt> </tt>
<a name="L42"></a><tt class="py-lineno"> 42</tt>  <tt class="py-line"> </tt>
<a name="L43"></a><tt class="py-lineno"> 43</tt>  <tt class="py-line"><tt class="py-comment"># Might want to determine special cases from the list of players, automatically. Later version.</tt> </tt>
<a name="L44"></a><tt class="py-lineno"> 44</tt>  <tt class="py-line"><tt id="link-19" class="py-name" targets="Variable tennisScore.specialCaseNames=tennisScore-module.html#specialCaseNames"><a title="tennisScore.specialCaseNames" class="py-name" href="#" onclick="return doclink('link-19', 'specialCaseNames', 'link-19');">specialCaseNames</a></tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">(</tt><tt class="py-string">'Pliskova'</tt><tt class="py-op">,</tt><tt class="py-string">'K'</tt><tt class="py-op">)</tt><tt class="py-op">]</tt> <tt class="py-comment"># Karolina and Kristyna</tt> </tt>
<a name="L45"></a><tt class="py-lineno"> 45</tt>  <tt class="py-line"> </tt>
<a name="Controller"></a><div id="Controller-def"><a name="L46"></a><tt class="py-lineno"> 46</tt> <a class="py-toggle" href="#" id="Controller-toggle" onclick="return toggle('Controller');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="tennisScore.Controller-class.html">Controller</a><tt class="py-op">:</tt> </tt>
</div><div id="Controller-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="Controller-expanded"><a name="L47"></a><tt class="py-lineno"> 47</tt>  <tt class="py-line">        <tt class="py-docstring">"""The controller for a tennis scoreboard program."""</tt> </tt>
<a name="Controller.__init__"></a><div id="Controller.__init__-def"><a name="L48"></a><tt class="py-lineno"> 48</tt> <a class="py-toggle" href="#" id="Controller.__init__-toggle" onclick="return toggle('Controller.__init__');">-</a><tt class="py-line">        <tt class="py-keyword">def</tt> <a class="py-def-name" href="tennisScore.Controller-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">root</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Controller.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++++++"></div><div id="Controller.__init__-expanded"><a name="L49"></a><tt class="py-lineno"> 49</tt>  <tt class="py-line">                <tt class="py-docstring">"""</tt> </tt>
<a name="L50"></a><tt class="py-lineno"> 50</tt>  <tt class="py-line"><tt class="py-docstring">                @type root: Toplevel widget</tt> </tt>
<a name="L51"></a><tt class="py-lineno"> 51</tt>  <tt class="py-line"><tt class="py-docstring">                @param root: Main application window.</tt> </tt>
<a name="L52"></a><tt class="py-lineno"> 52</tt>  <tt class="py-line"><tt class="py-docstring">                """</tt> </tt>
<a name="L53"></a><tt class="py-lineno"> 53</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt> <tt class="py-op">=</tt> <tt id="link-20" class="py-name"><a title="tennisModel.Model" class="py-name" href="#" onclick="return doclink('link-20', 'Model', 'link-3');">Model</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L54"></a><tt class="py-lineno"> 54</tt>  <tt class="py-line">                <tt class="py-comment"># Add needed callbacks for observable fields in Model</tt> </tt>
<a name="L55"></a><tt class="py-lineno"> 55</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">gameScore</tt><tt class="py-op">.</tt><tt id="link-21" class="py-name" targets="Method observable.Observable.addCallback()=observable.Observable-class.html#addCallback"><a title="observable.Observable.addCallback" class="py-name" href="#" onclick="return doclink('link-21', 'addCallback', 'link-21');">addCallback</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-22" class="py-name" targets="Method tennisScore.Controller.gameScoreChanged()=tennisScore.Controller-class.html#gameScoreChanged"><a title="tennisScore.Controller.gameScoreChanged" class="py-name" href="#" onclick="return doclink('link-22', 'gameScoreChanged', 'link-22');">gameScoreChanged</a></tt><tt class="py-op">)</tt> </tt>
<a name="L56"></a><tt class="py-lineno"> 56</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">setScore</tt><tt class="py-op">.</tt><tt id="link-23" class="py-name"><a title="observable.Observable.addCallback" class="py-name" href="#" onclick="return doclink('link-23', 'addCallback', 'link-21');">addCallback</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-24" class="py-name" targets="Method tennisScore.Controller.setScoreChanged()=tennisScore.Controller-class.html#setScoreChanged"><a title="tennisScore.Controller.setScoreChanged" class="py-name" href="#" onclick="return doclink('link-24', 'setScoreChanged', 'link-24');">setScoreChanged</a></tt><tt class="py-op">)</tt> </tt>
<a name="L57"></a><tt class="py-lineno"> 57</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">message</tt><tt class="py-op">.</tt><tt id="link-25" class="py-name"><a title="observable.Observable.addCallback" class="py-name" href="#" onclick="return doclink('link-25', 'addCallback', 'link-21');">addCallback</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-26" class="py-name" targets="Method tennisScore.Controller.messageChanged()=tennisScore.Controller-class.html#messageChanged"><a title="tennisScore.Controller.messageChanged" class="py-name" href="#" onclick="return doclink('link-26', 'messageChanged', 'link-26');">messageChanged</a></tt><tt class="py-op">)</tt> </tt>
<a name="L58"></a><tt class="py-lineno"> 58</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">server</tt><tt class="py-op">.</tt><tt id="link-27" class="py-name"><a title="observable.Observable.addCallback" class="py-name" href="#" onclick="return doclink('link-27', 'addCallback', 'link-21');">addCallback</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-28" class="py-name" targets="Method tennisScore.Controller.serverChanged()=tennisScore.Controller-class.html#serverChanged"><a title="tennisScore.Controller.serverChanged" class="py-name" href="#" onclick="return doclink('link-28', 'serverChanged', 'link-28');">serverChanged</a></tt><tt class="py-op">)</tt> </tt>
<a name="L59"></a><tt class="py-lineno"> 59</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">winner</tt><tt class="py-op">.</tt><tt id="link-29" class="py-name"><a title="observable.Observable.addCallback" class="py-name" href="#" onclick="return doclink('link-29', 'addCallback', 'link-21');">addCallback</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-30" class="py-name" targets="Method tennisScore.Controller.winnerNamed()=tennisScore.Controller-class.html#winnerNamed"><a title="tennisScore.Controller.winnerNamed" class="py-name" href="#" onclick="return doclink('link-30', 'winnerNamed', 'link-30');">winnerNamed</a></tt><tt class="py-op">)</tt> </tt>
<a name="L60"></a><tt class="py-lineno"> 60</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">tiebreak</tt><tt class="py-op">.</tt><tt id="link-31" class="py-name"><a title="observable.Observable.addCallback" class="py-name" href="#" onclick="return doclink('link-31', 'addCallback', 'link-21');">addCallback</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-32" class="py-name" targets="Method tennisScore.Controller.tiebreakChanged()=tennisScore.Controller-class.html#tiebreakChanged"><a title="tennisScore.Controller.tiebreakChanged" class="py-name" href="#" onclick="return doclink('link-32', 'tiebreakChanged', 'link-32');">tiebreakChanged</a></tt><tt class="py-op">)</tt> </tt>
<a name="L61"></a><tt class="py-lineno"> 61</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">currentSet</tt><tt class="py-op">.</tt><tt id="link-33" class="py-name"><a title="observable.Observable.addCallback" class="py-name" href="#" onclick="return doclink('link-33', 'addCallback', 'link-21');">addCallback</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-34" class="py-name" targets="Method tennisScore.Controller.setChanged()=tennisScore.Controller-class.html#setChanged"><a title="tennisScore.Controller.setChanged" class="py-name" href="#" onclick="return doclink('link-34', 'setChanged', 'link-34');">setChanged</a></tt><tt class="py-op">)</tt> </tt>
<a name="L62"></a><tt class="py-lineno"> 62</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">team</tt><tt class="py-op">.</tt><tt id="link-35" class="py-name"><a title="observable.Observable.addCallback" class="py-name" href="#" onclick="return doclink('link-35', 'addCallback', 'link-21');">addCallback</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-36" class="py-name" targets="Method tennisScore.Controller.teamChanged()=tennisScore.Controller-class.html#teamChanged"><a title="tennisScore.Controller.teamChanged" class="py-name" href="#" onclick="return doclink('link-36', 'teamChanged', 'link-36');">teamChanged</a></tt><tt class="py-op">)</tt> </tt>
<a name="L63"></a><tt class="py-lineno"> 63</tt>  <tt class="py-line">                <tt class="py-comment"># Presents first setup dialog (just whether singles or doubles match)</tt> </tt>
<a name="L64"></a><tt class="py-lineno"> 64</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">viewSetup1</tt> <tt class="py-op">=</tt> <tt id="link-37" class="py-name"><a title="setup1.Setup1" class="py-name" href="#" onclick="return doclink('link-37', 'Setup1', 'link-7');">Setup1</a></tt><tt class="py-op">(</tt><tt class="py-name">root</tt><tt class="py-op">)</tt> </tt>
<a name="L65"></a><tt class="py-lineno"> 65</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">viewSetup1</tt><tt class="py-op">.</tt><tt class="py-name">nextButton</tt><tt class="py-op">.</tt><tt class="py-name">config</tt><tt class="py-op">(</tt><tt class="py-name">command</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-38" class="py-name" targets="Method tennisScore.Controller.singles()=tennisScore.Controller-class.html#singles"><a title="tennisScore.Controller.singles" class="py-name" href="#" onclick="return doclink('link-38', 'singles', 'link-38');">singles</a></tt><tt class="py-op">)</tt> </tt>
</div><a name="L66"></a><tt class="py-lineno"> 66</tt>  <tt class="py-line"> </tt>
<a name="Controller.initTennisView"></a><div id="Controller.initTennisView-def"><a name="L67"></a><tt class="py-lineno"> 67</tt> <a class="py-toggle" href="#" id="Controller.initTennisView-toggle" onclick="return toggle('Controller.initTennisView');">-</a><tt class="py-line">        <tt class="py-keyword">def</tt> <a class="py-def-name" href="tennisScore.Controller-class.html#initTennisView">initTennisView</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Controller.initTennisView-collapsed" style="display:none;" pad="+++" indent="++++++++++++"></div><div id="Controller.initTennisView-expanded"><a name="L68"></a><tt class="py-lineno"> 68</tt>  <tt class="py-line">                <tt class="py-docstring">"""Initializes the scoreboard in the View class."""</tt> </tt>
<a name="L69"></a><tt class="py-lineno"> 69</tt>  <tt class="py-line">                <tt id="link-39" class="py-name"><a title="util" class="py-name" href="#" onclick="return doclink('link-39', 'util', 'link-17');">util</a></tt><tt class="py-op">.</tt><tt id="link-40" class="py-name" targets="Function util.dbgprint()=util-module.html#dbgprint"><a title="util.dbgprint" class="py-name" href="#" onclick="return doclink('link-40', 'dbgprint', 'link-40');">dbgprint</a></tt><tt class="py-op">(</tt><tt id="link-41" class="py-name"><a title="tennisModel.DEBUG
tennisScore.DEBUG
tennisView.DEBUG" class="py-name" href="#" onclick="return doclink('link-41', 'DEBUG', 'link-18');">DEBUG</a></tt><tt class="py-op">,</tt><tt class="py-string">"initTennisView:"</tt><tt class="py-op">)</tt> </tt>
<a name="L70"></a><tt class="py-lineno"> 70</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-42" class="py-name"><a title="tennisScore.Controller.teamChanged" class="py-name" href="#" onclick="return doclink('link-42', 'teamChanged', 'link-36');">teamChanged</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">team</tt><tt class="py-op">)</tt>  <tt class="py-comment"># set the initial value of the tams in the view</tt> </tt>
<a name="L71"></a><tt class="py-lineno"> 71</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-43" class="py-name"><a title="tennisScore.Controller.setChanged" class="py-name" href="#" onclick="return doclink('link-43', 'setChanged', 'link-34');">setChanged</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">currentSet</tt><tt class="py-op">.</tt><tt id="link-44" class="py-name" targets="Method observable.Observable.get()=observable.Observable-class.html#get"><a title="observable.Observable.get" class="py-name" href="#" onclick="return doclink('link-44', 'get', 'link-44');">get</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt>  <tt class="py-comment"># set the initial value of the set # in the view</tt> </tt>
<a name="L72"></a><tt class="py-lineno"> 72</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-45" class="py-name"><a title="tennisScore.Controller.messageChanged" class="py-name" href="#" onclick="return doclink('link-45', 'messageChanged', 'link-26');">messageChanged</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">message</tt><tt class="py-op">.</tt><tt id="link-46" class="py-name"><a title="observable.Observable.get" class="py-name" href="#" onclick="return doclink('link-46', 'get', 'link-44');">get</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt>  <tt class="py-comment"># set the initial value of the message in the view</tt> </tt>
<a name="L73"></a><tt class="py-lineno"> 73</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-47" class="py-name"><a title="tennisScore.Controller.serverChanged" class="py-name" href="#" onclick="return doclink('link-47', 'serverChanged', 'link-28');">serverChanged</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">server</tt><tt class="py-op">.</tt><tt id="link-48" class="py-name"><a title="observable.Observable.get" class="py-name" href="#" onclick="return doclink('link-48', 'get', 'link-44');">get</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt>  <tt class="py-comment"># set the initial value of the server in the view</tt> </tt>
<a name="L74"></a><tt class="py-lineno"> 74</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-49" class="py-name"><a title="tennisScore.Controller.winnerNamed" class="py-name" href="#" onclick="return doclink('link-49', 'winnerNamed', 'link-30');">winnerNamed</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">winner</tt><tt class="py-op">.</tt><tt id="link-50" class="py-name"><a title="observable.Observable.get" class="py-name" href="#" onclick="return doclink('link-50', 'get', 'link-44');">get</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt>  <tt class="py-comment"># set the initial value of the winner in the view</tt> </tt>
</div><a name="L75"></a><tt class="py-lineno"> 75</tt>  <tt class="py-line"> </tt>
<a name="Controller.gameScoreChanged"></a><div id="Controller.gameScoreChanged-def"><a name="L76"></a><tt class="py-lineno"> 76</tt> <a class="py-toggle" href="#" id="Controller.gameScoreChanged-toggle" onclick="return toggle('Controller.gameScoreChanged');">-</a><tt class="py-line">        <tt class="py-keyword">def</tt> <a class="py-def-name" href="tennisScore.Controller-class.html#gameScoreChanged">gameScoreChanged</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">gameScore</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Controller.gameScoreChanged-collapsed" style="display:none;" pad="+++" indent="++++++++++++"></div><div id="Controller.gameScoreChanged-expanded"><a name="L77"></a><tt class="py-lineno"> 77</tt>  <tt class="py-line">                <tt class="py-docstring">"""</tt> </tt>
<a name="L78"></a><tt class="py-lineno"> 78</tt>  <tt class="py-line"><tt class="py-docstring">                Updates the game score in scoreboard.</tt> </tt>
<a name="L79"></a><tt class="py-lineno"> 79</tt>  <tt class="py-line"><tt class="py-docstring">                @type gameScore: list of integers</tt> </tt>
<a name="L80"></a><tt class="py-lineno"> 80</tt>  <tt class="py-line"><tt class="py-docstring">                @param gameScore: The current game score.</tt> </tt>
<a name="L81"></a><tt class="py-lineno"> 81</tt>  <tt class="py-line"><tt class="py-docstring">                """</tt> </tt>
<a name="L82"></a><tt class="py-lineno"> 82</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scoreboard</tt><tt class="py-op">.</tt><tt id="link-51" class="py-name" targets="Method tennisView.View.setGameScore()=tennisView.View-class.html#setGameScore"><a title="tennisView.View.setGameScore" class="py-name" href="#" onclick="return doclink('link-51', 'setGameScore', 'link-51');">setGameScore</a></tt><tt class="py-op">(</tt><tt class="py-name">gameScore</tt><tt class="py-op">)</tt> </tt>
</div><a name="L83"></a><tt class="py-lineno"> 83</tt>  <tt class="py-line"> </tt>
<a name="Controller.setChanged"></a><div id="Controller.setChanged-def"><a name="L84"></a><tt class="py-lineno"> 84</tt> <a class="py-toggle" href="#" id="Controller.setChanged-toggle" onclick="return toggle('Controller.setChanged');">-</a><tt class="py-line">        <tt class="py-keyword">def</tt> <a class="py-def-name" href="tennisScore.Controller-class.html#setChanged">setChanged</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">currentSet</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Controller.setChanged-collapsed" style="display:none;" pad="+++" indent="++++++++++++"></div><div id="Controller.setChanged-expanded"><a name="L85"></a><tt class="py-lineno"> 85</tt>  <tt class="py-line">                <tt class="py-docstring">"""</tt> </tt>
<a name="L86"></a><tt class="py-lineno"> 86</tt>  <tt class="py-line"><tt class="py-docstring">                Updates the set number for scoreboard.</tt> </tt>
<a name="L87"></a><tt class="py-lineno"> 87</tt>  <tt class="py-line"><tt class="py-docstring">                @type currentSet: integer</tt> </tt>
<a name="L88"></a><tt class="py-lineno"> 88</tt>  <tt class="py-line"><tt class="py-docstring">                @param currentSet: The current set (0 = first set).</tt> </tt>
<a name="L89"></a><tt class="py-lineno"> 89</tt>  <tt class="py-line"><tt class="py-docstring">                """</tt> </tt>
<a name="L90"></a><tt class="py-lineno"> 90</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scoreboard</tt><tt class="py-op">.</tt><tt id="link-52" class="py-name" targets="Method tennisView.View.setSet()=tennisView.View-class.html#setSet"><a title="tennisView.View.setSet" class="py-name" href="#" onclick="return doclink('link-52', 'setSet', 'link-52');">setSet</a></tt><tt class="py-op">(</tt><tt class="py-name">currentSet</tt><tt class="py-op">)</tt> </tt>
</div><a name="L91"></a><tt class="py-lineno"> 91</tt>  <tt class="py-line">                 </tt>
<a name="Controller.setScoreChanged"></a><div id="Controller.setScoreChanged-def"><a name="L92"></a><tt class="py-lineno"> 92</tt> <a class="py-toggle" href="#" id="Controller.setScoreChanged-toggle" onclick="return toggle('Controller.setScoreChanged');">-</a><tt class="py-line">        <tt class="py-keyword">def</tt> <a class="py-def-name" href="tennisScore.Controller-class.html#setScoreChanged">setScoreChanged</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">setScore</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Controller.setScoreChanged-collapsed" style="display:none;" pad="+++" indent="++++++++++++"></div><div id="Controller.setScoreChanged-expanded"><a name="L93"></a><tt class="py-lineno"> 93</tt>  <tt class="py-line">                <tt class="py-docstring">"""</tt> </tt>
<a name="L94"></a><tt class="py-lineno"> 94</tt>  <tt class="py-line"><tt class="py-docstring">                Updates the set score in scoreboard.</tt> </tt>
<a name="L95"></a><tt class="py-lineno"> 95</tt>  <tt class="py-line"><tt class="py-docstring">                @type setScore: list of integers</tt> </tt>
<a name="L96"></a><tt class="py-lineno"> 96</tt>  <tt class="py-line"><tt class="py-docstring">                @param setScore: The current set score.</tt> </tt>
<a name="L97"></a><tt class="py-lineno"> 97</tt>  <tt class="py-line"><tt class="py-docstring">                """</tt> </tt>
<a name="L98"></a><tt class="py-lineno"> 98</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scoreboard</tt><tt class="py-op">.</tt><tt id="link-53" class="py-name" targets="Method tennisView.View.setSetScore()=tennisView.View-class.html#setSetScore"><a title="tennisView.View.setSetScore" class="py-name" href="#" onclick="return doclink('link-53', 'setSetScore', 'link-53');">setSetScore</a></tt><tt class="py-op">(</tt><tt class="py-name">setScore</tt><tt class="py-op">)</tt> </tt>
</div><a name="L99"></a><tt class="py-lineno"> 99</tt>  <tt class="py-line"> </tt>
<a name="Controller.messageChanged"></a><div id="Controller.messageChanged-def"><a name="L100"></a><tt class="py-lineno">100</tt> <a class="py-toggle" href="#" id="Controller.messageChanged-toggle" onclick="return toggle('Controller.messageChanged');">-</a><tt class="py-line">        <tt class="py-keyword">def</tt> <a class="py-def-name" href="tennisScore.Controller-class.html#messageChanged">messageChanged</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">message</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Controller.messageChanged-collapsed" style="display:none;" pad="+++" indent="++++++++++++"></div><div id="Controller.messageChanged-expanded"><a name="L101"></a><tt class="py-lineno">101</tt>  <tt class="py-line">                <tt class="py-docstring">"""</tt> </tt>
<a name="L102"></a><tt class="py-lineno">102</tt>  <tt class="py-line"><tt class="py-docstring">                Updates the message to be displayed on the scoreboard.</tt> </tt>
<a name="L103"></a><tt class="py-lineno">103</tt>  <tt class="py-line"><tt class="py-docstring">                @type message: string</tt> </tt>
<a name="L104"></a><tt class="py-lineno">104</tt>  <tt class="py-line"><tt class="py-docstring">                @param message: The message to be displayed on the scoreboard.</tt> </tt>
<a name="L105"></a><tt class="py-lineno">105</tt>  <tt class="py-line"><tt class="py-docstring">                """</tt> </tt>
<a name="L106"></a><tt class="py-lineno">106</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scoreboard</tt><tt class="py-op">.</tt><tt id="link-54" class="py-name" targets="Method tennisView.View.setMessage()=tennisView.View-class.html#setMessage"><a title="tennisView.View.setMessage" class="py-name" href="#" onclick="return doclink('link-54', 'setMessage', 'link-54');">setMessage</a></tt><tt class="py-op">(</tt><tt class="py-name">message</tt><tt class="py-op">)</tt> </tt>
</div><a name="L107"></a><tt class="py-lineno">107</tt>  <tt class="py-line"> </tt>
<a name="Controller.serverChanged"></a><div id="Controller.serverChanged-def"><a name="L108"></a><tt class="py-lineno">108</tt> <a class="py-toggle" href="#" id="Controller.serverChanged-toggle" onclick="return toggle('Controller.serverChanged');">-</a><tt class="py-line">        <tt class="py-keyword">def</tt> <a class="py-def-name" href="tennisScore.Controller-class.html#serverChanged">serverChanged</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">server</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Controller.serverChanged-collapsed" style="display:none;" pad="+++" indent="++++++++++++"></div><div id="Controller.serverChanged-expanded"><a name="L109"></a><tt class="py-lineno">109</tt>  <tt class="py-line">                <tt class="py-docstring">"""</tt> </tt>
<a name="L110"></a><tt class="py-lineno">110</tt>  <tt class="py-line"><tt class="py-docstring">                Updates which team / player is serving.</tt> </tt>
<a name="L111"></a><tt class="py-lineno">111</tt>  <tt class="py-line"><tt class="py-docstring">                @type server: integer</tt> </tt>
<a name="L112"></a><tt class="py-lineno">112</tt>  <tt class="py-line"><tt class="py-docstring">                @param server: The number of the team / player now serving.</tt> </tt>
<a name="L113"></a><tt class="py-lineno">113</tt>  <tt class="py-line"><tt class="py-docstring">                """</tt> </tt>
<a name="L114"></a><tt class="py-lineno">114</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scoreboard</tt><tt class="py-op">.</tt><tt id="link-55" class="py-name" targets="Method tennisView.View.setServer()=tennisView.View-class.html#setServer"><a title="tennisView.View.setServer" class="py-name" href="#" onclick="return doclink('link-55', 'setServer', 'link-55');">setServer</a></tt><tt class="py-op">(</tt><tt class="py-name">server</tt><tt class="py-op">)</tt> </tt>
</div><a name="L115"></a><tt class="py-lineno">115</tt>  <tt class="py-line"> </tt>
<a name="Controller.teamChanged"></a><div id="Controller.teamChanged-def"><a name="L116"></a><tt class="py-lineno">116</tt> <a class="py-toggle" href="#" id="Controller.teamChanged-toggle" onclick="return toggle('Controller.teamChanged');">-</a><tt class="py-line">        <tt class="py-keyword">def</tt> <a class="py-def-name" href="tennisScore.Controller-class.html#teamChanged">teamChanged</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">team</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Controller.teamChanged-collapsed" style="display:none;" pad="+++" indent="++++++++++++"></div><div id="Controller.teamChanged-expanded"><a name="L117"></a><tt class="py-lineno">117</tt>  <tt class="py-line">                <tt class="py-docstring">"""</tt> </tt>
<a name="L118"></a><tt class="py-lineno">118</tt>  <tt class="py-line"><tt class="py-docstring">                Updates the Team objects and their scoreboard names.</tt> </tt>
<a name="L119"></a><tt class="py-lineno">119</tt>  <tt class="py-line"><tt class="py-docstring">                @type team: list of Team objects</tt> </tt>
<a name="L120"></a><tt class="py-lineno">120</tt>  <tt class="py-line"><tt class="py-docstring">                @param team: The Team objects for the current match.</tt> </tt>
<a name="L121"></a><tt class="py-lineno">121</tt>  <tt class="py-line"><tt class="py-docstring">                """</tt> </tt>
<a name="L122"></a><tt class="py-lineno">122</tt>  <tt class="py-line">                <tt class="py-comment"># Set the Team objects in the view</tt> </tt>
<a name="L123"></a><tt class="py-lineno">123</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scoreboard</tt><tt class="py-op">.</tt><tt id="link-56" class="py-name" targets="Method tennisView.View.setTeam()=tennisView.View-class.html#setTeam"><a title="tennisView.View.setTeam" class="py-name" href="#" onclick="return doclink('link-56', 'setTeam', 'link-56');">setTeam</a></tt><tt class="py-op">(</tt><tt class="py-name">team</tt><tt class="py-op">)</tt> </tt>
<a name="L124"></a><tt class="py-lineno">124</tt>  <tt class="py-line">                <tt class="py-comment"># Set the score names for the teams in the view</tt> </tt>
<a name="L125"></a><tt class="py-lineno">125</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scoreboard</tt><tt class="py-op">.</tt><tt id="link-57" class="py-name" targets="Method tennisView.View.setTeamMembers()=tennisView.View-class.html#setTeamMembers"><a title="tennisView.View.setTeamMembers" class="py-name" href="#" onclick="return doclink('link-57', 'setTeamMembers', 'link-57');">setTeamMembers</a></tt><tt class="py-op">(</tt> </tt>
<a name="L126"></a><tt class="py-lineno">126</tt>  <tt class="py-line">                        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">team</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-58" class="py-name" targets="Method player.Player.scoreName()=player.Player-class.html#scoreName,Method player.Team.scoreName()=player.Team-class.html#scoreName"><a title="player.Player.scoreName
player.Team.scoreName" class="py-name" href="#" onclick="return doclink('link-58', 'scoreName', 'link-58');">scoreName</a></tt><tt class="py-op">(</tt><tt class="py-name">dups</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">duplicateLastName</tt><tt class="py-op">,</tt> <tt class="py-name">special</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt id="link-59" class="py-name"><a title="tennisScore.specialCaseNames" class="py-name" href="#" onclick="return doclink('link-59', 'specialCaseNames', 'link-19');">specialCaseNames</a></tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L127"></a><tt class="py-lineno">127</tt>  <tt class="py-line">                        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">team</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-60" class="py-name"><a title="player.Player.scoreName
player.Team.scoreName" class="py-name" href="#" onclick="return doclink('link-60', 'scoreName', 'link-58');">scoreName</a></tt><tt class="py-op">(</tt><tt class="py-name">dups</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">duplicateLastName</tt><tt class="py-op">,</tt> <tt class="py-name">special</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt id="link-61" class="py-name"><a title="tennisScore.specialCaseNames" class="py-name" href="#" onclick="return doclink('link-61', 'specialCaseNames', 'link-19');">specialCaseNames</a></tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L128"></a><tt class="py-lineno">128</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">teamScoreNames</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt> </tt>
<a name="L129"></a><tt class="py-lineno">129</tt>  <tt class="py-line">                        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">team</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-62" class="py-name"><a title="player.Player.scoreName
player.Team.scoreName" class="py-name" href="#" onclick="return doclink('link-62', 'scoreName', 'link-58');">scoreName</a></tt><tt class="py-op">(</tt><tt class="py-name">dups</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">duplicateLastName</tt><tt class="py-op">,</tt> <tt class="py-name">special</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt id="link-63" class="py-name"><a title="tennisScore.specialCaseNames" class="py-name" href="#" onclick="return doclink('link-63', 'specialCaseNames', 'link-19');">specialCaseNames</a></tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L130"></a><tt class="py-lineno">130</tt>  <tt class="py-line">                        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">team</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-64" class="py-name"><a title="player.Player.scoreName
player.Team.scoreName" class="py-name" href="#" onclick="return doclink('link-64', 'scoreName', 'link-58');">scoreName</a></tt><tt class="py-op">(</tt><tt class="py-name">dups</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">duplicateLastName</tt><tt class="py-op">,</tt> <tt class="py-name">special</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt id="link-65" class="py-name"><a title="tennisScore.specialCaseNames" class="py-name" href="#" onclick="return doclink('link-65', 'specialCaseNames', 'link-19');">specialCaseNames</a></tt><tt class="py-op">)</tt><tt class="py-op">]</tt> </tt>
</div><a name="L131"></a><tt class="py-lineno">131</tt>  <tt class="py-line"> </tt>
<a name="Controller.winnerNamed"></a><div id="Controller.winnerNamed-def"><a name="L132"></a><tt class="py-lineno">132</tt> <a class="py-toggle" href="#" id="Controller.winnerNamed-toggle" onclick="return toggle('Controller.winnerNamed');">-</a><tt class="py-line">        <tt class="py-keyword">def</tt> <a class="py-def-name" href="tennisScore.Controller-class.html#winnerNamed">winnerNamed</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">winner</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Controller.winnerNamed-collapsed" style="display:none;" pad="+++" indent="++++++++++++"></div><div id="Controller.winnerNamed-expanded"><a name="L133"></a><tt class="py-lineno">133</tt>  <tt class="py-line">                <tt class="py-docstring">"""</tt> </tt>
<a name="L134"></a><tt class="py-lineno">134</tt>  <tt class="py-line"><tt class="py-docstring">                Sets the winning team for the current match. Shows message, and photo(s).</tt> </tt>
<a name="L135"></a><tt class="py-lineno">135</tt>  <tt class="py-line"><tt class="py-docstring">                @type winner: integer</tt> </tt>
<a name="L136"></a><tt class="py-lineno">136</tt>  <tt class="py-line"><tt class="py-docstring">                @param winner: The number of the winning team / player.</tt> </tt>
<a name="L137"></a><tt class="py-lineno">137</tt>  <tt class="py-line"><tt class="py-docstring">                """</tt> </tt>
<a name="L138"></a><tt class="py-lineno">138</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-op">(</tt><tt class="py-name">winner</tt> <tt class="py-op">&gt;=</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-comment"># winner &lt; 0 means no winner yet</tt> </tt>
<a name="L139"></a><tt class="py-lineno">139</tt>  <tt class="py-line">                        <tt id="link-66" class="py-name"><a title="util" class="py-name" href="#" onclick="return doclink('link-66', 'util', 'link-17');">util</a></tt><tt class="py-op">.</tt><tt id="link-67" class="py-name"><a title="util.dbgprint" class="py-name" href="#" onclick="return doclink('link-67', 'dbgprint', 'link-40');">dbgprint</a></tt><tt class="py-op">(</tt><tt id="link-68" class="py-name"><a title="tennisModel.DEBUG
tennisScore.DEBUG
tennisView.DEBUG" class="py-name" href="#" onclick="return doclink('link-68', 'DEBUG', 'link-18');">DEBUG</a></tt><tt class="py-op">,</tt> <tt class="py-string">"In controller, winnerNamed."</tt><tt class="py-op">)</tt> </tt>
<a name="L140"></a><tt class="py-lineno">140</tt>  <tt class="py-line">                        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scoreboard</tt><tt class="py-op">.</tt><tt id="link-69" class="py-name"><a title="tennisView.View.setMessage" class="py-name" href="#" onclick="return doclink('link-69', 'setMessage', 'link-54');">setMessage</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">teamScoreNames</tt><tt class="py-op">[</tt><tt class="py-name">winner</tt><tt class="py-op">]</tt><tt class="py-op">+</tt><tt class="py-string">" won!"</tt><tt class="py-op">)</tt> </tt>
<a name="L141"></a><tt class="py-lineno">141</tt>  <tt class="py-line">                        <tt class="py-comment"># Show the winner photo(s) if available</tt> </tt>
<a name="L142"></a><tt class="py-lineno">142</tt>  <tt class="py-line">                        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scoreboard</tt><tt class="py-op">.</tt><tt id="link-70" class="py-name" targets="Method tennisView.View.showWinnerPhotos()=tennisView.View-class.html#showWinnerPhotos"><a title="tennisView.View.showWinnerPhotos" class="py-name" href="#" onclick="return doclink('link-70', 'showWinnerPhotos', 'link-70');">showWinnerPhotos</a></tt><tt class="py-op">(</tt><tt class="py-name">winner</tt><tt class="py-op">)</tt> </tt>
<a name="L143"></a><tt class="py-lineno">143</tt>  <tt class="py-line">                        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scoreboard</tt><tt class="py-op">.</tt><tt id="link-71" class="py-name" targets="Method tennisView.View.setSetColorsSame()=tennisView.View-class.html#setSetColorsSame"><a title="tennisView.View.setSetColorsSame" class="py-name" href="#" onclick="return doclink('link-71', 'setSetColorsSame', 'link-71');">setSetColorsSame</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L144"></a><tt class="py-lineno">144</tt>  <tt class="py-line">                        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scoringView</tt><tt class="py-op">.</tt><tt class="py-name">destroy</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L145"></a><tt class="py-lineno">145</tt>  <tt class="py-line"> </tt>
<a name="Controller.tiebreakChanged"></a><div id="Controller.tiebreakChanged-def"><a name="L146"></a><tt class="py-lineno">146</tt> <a class="py-toggle" href="#" id="Controller.tiebreakChanged-toggle" onclick="return toggle('Controller.tiebreakChanged');">-</a><tt class="py-line">        <tt class="py-keyword">def</tt> <a class="py-def-name" href="tennisScore.Controller-class.html#tiebreakChanged">tiebreakChanged</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">tiebreak</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Controller.tiebreakChanged-collapsed" style="display:none;" pad="+++" indent="++++++++++++"></div><div id="Controller.tiebreakChanged-expanded"><a name="L147"></a><tt class="py-lineno">147</tt>  <tt class="py-line">                <tt class="py-docstring">"""</tt> </tt>
<a name="L148"></a><tt class="py-lineno">148</tt>  <tt class="py-line"><tt class="py-docstring">                Updates whether currently in a tiebreak.</tt> </tt>
<a name="L149"></a><tt class="py-lineno">149</tt>  <tt class="py-line"><tt class="py-docstring">                @type tiebreak: boolean</tt> </tt>
<a name="L150"></a><tt class="py-lineno">150</tt>  <tt class="py-line"><tt class="py-docstring">                @param tiebreak: Flag, True if currently in a tiebreak.</tt> </tt>
<a name="L151"></a><tt class="py-lineno">151</tt>  <tt class="py-line"><tt class="py-docstring">                """</tt> </tt>
<a name="L152"></a><tt class="py-lineno">152</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scoreboard</tt><tt class="py-op">.</tt><tt id="link-72" class="py-name" targets="Method tennisView.View.setTiebreak()=tennisView.View-class.html#setTiebreak"><a title="tennisView.View.setTiebreak" class="py-name" href="#" onclick="return doclink('link-72', 'setTiebreak', 'link-72');">setTiebreak</a></tt><tt class="py-op">(</tt><tt class="py-name">tiebreak</tt><tt class="py-op">)</tt> </tt>
</div><a name="L153"></a><tt class="py-lineno">153</tt>  <tt class="py-line"> </tt>
<a name="Controller.incrementGameScore"></a><div id="Controller.incrementGameScore-def"><a name="L154"></a><tt class="py-lineno">154</tt> <a class="py-toggle" href="#" id="Controller.incrementGameScore-toggle" onclick="return toggle('Controller.incrementGameScore');">-</a><tt class="py-line">        <tt class="py-keyword">def</tt> <a class="py-def-name" href="tennisScore.Controller-class.html#incrementGameScore">incrementGameScore</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">team</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Controller.incrementGameScore-collapsed" style="display:none;" pad="+++" indent="++++++++++++"></div><div id="Controller.incrementGameScore-expanded"><a name="L155"></a><tt class="py-lineno">155</tt>  <tt class="py-line">                <tt class="py-docstring">"""</tt> </tt>
<a name="L156"></a><tt class="py-lineno">156</tt>  <tt class="py-line"><tt class="py-docstring">                Increments the current game score by one for the scoring team.</tt> </tt>
<a name="L157"></a><tt class="py-lineno">157</tt>  <tt class="py-line"><tt class="py-docstring">                @type team: integer</tt> </tt>
<a name="L158"></a><tt class="py-lineno">158</tt>  <tt class="py-line"><tt class="py-docstring">                @param team: The scoring team.</tt> </tt>
<a name="L159"></a><tt class="py-lineno">159</tt>  <tt class="py-line"><tt class="py-docstring">                """</tt> </tt>
<a name="L160"></a><tt class="py-lineno">160</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt id="link-73" class="py-name" targets="Method tennisModel.Model.incrementGameScore()=tennisModel.Model-class.html#incrementGameScore,Method tennisScore.Controller.incrementGameScore()=tennisScore.Controller-class.html#incrementGameScore"><a title="tennisModel.Model.incrementGameScore
tennisScore.Controller.incrementGameScore" class="py-name" href="#" onclick="return doclink('link-73', 'incrementGameScore', 'link-73');">incrementGameScore</a></tt><tt class="py-op">(</tt><tt class="py-name">team</tt><tt class="py-op">)</tt> </tt>
</div><a name="L161"></a><tt class="py-lineno">161</tt>  <tt class="py-line"> </tt>
<a name="Controller.singles"></a><div id="Controller.singles-def"><a name="L162"></a><tt class="py-lineno">162</tt> <a class="py-toggle" href="#" id="Controller.singles-toggle" onclick="return toggle('Controller.singles');">-</a><tt class="py-line">        <tt class="py-keyword">def</tt> <a class="py-def-name" href="tennisScore.Controller-class.html#singles">singles</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-comment"># Check for singles or doubles match</tt> </tt>
</div><a name="L163"></a><tt class="py-lineno">163</tt>  <tt class="py-line">                <tt class="py-docstring">"""Interprets first setup dialog. Determines whether the current match is singles or doubles. Also, presents next setup dialog."""</tt> </tt>
<a name="L164"></a><tt class="py-lineno">164</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">doublesMatch</tt><tt class="py-op">.</tt><tt id="link-74" class="py-name" targets="Method observable.Observable.set()=observable.Observable-class.html#set"><a title="observable.Observable.set" class="py-name" href="#" onclick="return doclink('link-74', 'set', 'link-74');">set</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">viewSetup1</tt><tt class="py-op">.</tt><tt id="link-75" class="py-name" targets="Method setup1.Setup1.getDoublesMatch()=setup1.Setup1-class.html#getDoublesMatch"><a title="setup1.Setup1.getDoublesMatch" class="py-name" href="#" onclick="return doclink('link-75', 'getDoublesMatch', 'link-75');">getDoublesMatch</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L165"></a><tt class="py-lineno">165</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt id="link-76" class="py-name"><a title="tennisModel.DEBUG
tennisScore.DEBUG
tennisView.DEBUG" class="py-name" href="#" onclick="return doclink('link-76', 'DEBUG', 'link-18');">DEBUG</a></tt><tt class="py-op">:</tt> </tt>
<a name="L166"></a><tt class="py-lineno">166</tt>  <tt class="py-line">                        <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">doublesMatch</tt><tt class="py-op">.</tt><tt id="link-77" class="py-name"><a title="observable.Observable.get" class="py-name" href="#" onclick="return doclink('link-77', 'get', 'link-44');">get</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L167"></a><tt class="py-lineno">167</tt>  <tt class="py-line">                                <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-string">"Doubles"</tt><tt class="py-op">)</tt> </tt>
<a name="L168"></a><tt class="py-lineno">168</tt>  <tt class="py-line">                        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L169"></a><tt class="py-lineno">169</tt>  <tt class="py-line">                                <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-string">"Singles"</tt><tt class="py-op">)</tt> </tt>
<a name="L170"></a><tt class="py-lineno">170</tt>  <tt class="py-line">                <tt class="py-comment"># Present next setup dialog, destroy current dialog</tt> </tt>
<a name="L171"></a><tt class="py-lineno">171</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">viewSetup2</tt> <tt class="py-op">=</tt> <tt id="link-78" class="py-name"><a title="setup2.Setup2" class="py-name" href="#" onclick="return doclink('link-78', 'Setup2', 'link-9');">Setup2</a></tt><tt class="py-op">(</tt><tt class="py-name">root</tt><tt class="py-op">,</tt> <tt class="py-keyword">not</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">doublesMatch</tt><tt class="py-op">.</tt><tt id="link-79" class="py-name"><a title="observable.Observable.get" class="py-name" href="#" onclick="return doclink('link-79', 'get', 'link-44');">get</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L172"></a><tt class="py-lineno">172</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">viewSetup2</tt><tt class="py-op">.</tt><tt class="py-name">nextButton</tt><tt class="py-op">.</tt><tt class="py-name">config</tt><tt class="py-op">(</tt><tt class="py-name">command</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-80" class="py-name"><a title="setup2
tennisScore.Controller.setup2" class="py-name" href="#" onclick="return doclink('link-80', 'setup2', 'link-8');">setup2</a></tt><tt class="py-op">)</tt> </tt>
<a name="L173"></a><tt class="py-lineno">173</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">viewSetup1</tt><tt class="py-op">.</tt><tt class="py-name">destroy</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L174"></a><tt class="py-lineno">174</tt>  <tt class="py-line"> </tt>
<a name="Controller.setup2"></a><div id="Controller.setup2-def"><a name="L175"></a><tt class="py-lineno">175</tt> <a class="py-toggle" href="#" id="Controller.setup2-toggle" onclick="return toggle('Controller.setup2');">-</a><tt class="py-line">        <tt class="py-keyword">def</tt> <a class="py-def-name" href="tennisScore.Controller-class.html#setup2">setup2</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Controller.setup2-collapsed" style="display:none;" pad="+++" indent="++++++++++++"></div><div id="Controller.setup2-expanded"><a name="L176"></a><tt class="py-lineno">176</tt>  <tt class="py-line">                <tt class="py-docstring">"""Interprets second setup dialog. Determines mens / womens / mixed match. Whether end on tiebreak. Also, presents next setup dialog."""</tt> </tt>
<a name="L177"></a><tt class="py-lineno">177</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">mensMatch</tt><tt class="py-op">.</tt><tt id="link-81" class="py-name"><a title="observable.Observable.set" class="py-name" href="#" onclick="return doclink('link-81', 'set', 'link-74');">set</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">viewSetup2</tt><tt class="py-op">.</tt><tt id="link-82" class="py-name" targets="Method setup2.Setup2.getMensMatch()=setup2.Setup2-class.html#getMensMatch"><a title="setup2.Setup2.getMensMatch" class="py-name" href="#" onclick="return doclink('link-82', 'getMensMatch', 'link-82');">getMensMatch</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L178"></a><tt class="py-lineno">178</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt id="link-83" class="py-name"><a title="tennisModel.DEBUG
tennisScore.DEBUG
tennisView.DEBUG" class="py-name" href="#" onclick="return doclink('link-83', 'DEBUG', 'link-18');">DEBUG</a></tt><tt class="py-op">:</tt> </tt>
<a name="L179"></a><tt class="py-lineno">179</tt>  <tt class="py-line">                        <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">mensMatch</tt><tt class="py-op">.</tt><tt id="link-84" class="py-name"><a title="observable.Observable.get" class="py-name" href="#" onclick="return doclink('link-84', 'get', 'link-44');">get</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">==</tt><tt class="py-number">1</tt><tt class="py-op">:</tt> </tt>
<a name="L180"></a><tt class="py-lineno">180</tt>  <tt class="py-line">                                <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-string">"Men's"</tt><tt class="py-op">)</tt> </tt>
<a name="L181"></a><tt class="py-lineno">181</tt>  <tt class="py-line">                        <tt class="py-keyword">elif</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">mensMatch</tt><tt class="py-op">.</tt><tt id="link-85" class="py-name"><a title="observable.Observable.get" class="py-name" href="#" onclick="return doclink('link-85', 'get', 'link-44');">get</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-number">0</tt><tt class="py-op">:</tt> </tt>
<a name="L182"></a><tt class="py-lineno">182</tt>  <tt class="py-line">                                <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-string">"Women's"</tt><tt class="py-op">)</tt> </tt>
<a name="L183"></a><tt class="py-lineno">183</tt>  <tt class="py-line">                        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L184"></a><tt class="py-lineno">184</tt>  <tt class="py-line">                                <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-string">"Mixed doubles"</tt><tt class="py-op">)</tt> </tt>
<a name="L185"></a><tt class="py-lineno">185</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">noEndingTiebreak</tt><tt class="py-op">.</tt><tt id="link-86" class="py-name"><a title="observable.Observable.set" class="py-name" href="#" onclick="return doclink('link-86', 'set', 'link-74');">set</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">viewSetup2</tt><tt class="py-op">.</tt><tt id="link-87" class="py-name" targets="Method setup2.Setup2.getNoEndingTiebreak()=setup2.Setup2-class.html#getNoEndingTiebreak"><a title="setup2.Setup2.getNoEndingTiebreak" class="py-name" href="#" onclick="return doclink('link-87', 'getNoEndingTiebreak', 'link-87');">getNoEndingTiebreak</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L186"></a><tt class="py-lineno">186</tt>  <tt class="py-line">                <tt id="link-88" class="py-name"><a title="util" class="py-name" href="#" onclick="return doclink('link-88', 'util', 'link-17');">util</a></tt><tt class="py-op">.</tt><tt id="link-89" class="py-name"><a title="util.dbgprint" class="py-name" href="#" onclick="return doclink('link-89', 'dbgprint', 'link-40');">dbgprint</a></tt><tt class="py-op">(</tt><tt id="link-90" class="py-name"><a title="tennisModel.DEBUG
tennisScore.DEBUG
tennisView.DEBUG" class="py-name" href="#" onclick="return doclink('link-90', 'DEBUG', 'link-18');">DEBUG</a></tt><tt class="py-op">,</tt> <tt class="py-string">"No ending tiebreak is "</tt><tt class="py-op">+</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">noEndingTiebreak</tt><tt class="py-op">.</tt><tt id="link-91" class="py-name"><a title="observable.Observable.get" class="py-name" href="#" onclick="return doclink('link-91', 'get', 'link-44');">get</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L187"></a><tt class="py-lineno">187</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">matchType</tt><tt class="py-op">.</tt><tt id="link-92" class="py-name"><a title="observable.Observable.set" class="py-name" href="#" onclick="return doclink('link-92', 'set', 'link-74');">set</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">viewSetup2</tt><tt class="py-op">.</tt><tt class="py-name">matchType</tt><tt class="py-op">.</tt><tt id="link-93" class="py-name"><a title="observable.Observable.get" class="py-name" href="#" onclick="return doclink('link-93', 'get', 'link-44');">get</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L188"></a><tt class="py-lineno">188</tt>  <tt class="py-line">                <tt id="link-94" class="py-name"><a title="util" class="py-name" href="#" onclick="return doclink('link-94', 'util', 'link-17');">util</a></tt><tt class="py-op">.</tt><tt id="link-95" class="py-name"><a title="util.dbgprint" class="py-name" href="#" onclick="return doclink('link-95', 'dbgprint', 'link-40');">dbgprint</a></tt><tt class="py-op">(</tt><tt id="link-96" class="py-name"><a title="tennisModel.DEBUG
tennisScore.DEBUG
tennisView.DEBUG" class="py-name" href="#" onclick="return doclink('link-96', 'DEBUG', 'link-18');">DEBUG</a></tt><tt class="py-op">,</tt> <tt class="py-string">"Match type is: "</tt><tt class="py-op">+</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">matchType</tt><tt class="py-op">.</tt><tt id="link-97" class="py-name"><a title="observable.Observable.get" class="py-name" href="#" onclick="return doclink('link-97', 'get', 'link-44');">get</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L189"></a><tt class="py-lineno">189</tt>  <tt class="py-line">                <tt class="py-comment"># Present next setup dialog, destroy current dialog</tt> </tt>
<a name="L190"></a><tt class="py-lineno">190</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">viewSetup3</tt> <tt class="py-op">=</tt> <tt id="link-98" class="py-name"><a title="setup3.Setup3" class="py-name" href="#" onclick="return doclink('link-98', 'Setup3', 'link-11');">Setup3</a></tt><tt class="py-op">(</tt><tt class="py-name">root</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">mensMatch</tt><tt class="py-op">.</tt><tt id="link-99" class="py-name"><a title="observable.Observable.get" class="py-name" href="#" onclick="return doclink('link-99', 'get', 'link-44');">get</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">doublesMatch</tt><tt class="py-op">.</tt><tt id="link-100" class="py-name"><a title="observable.Observable.get" class="py-name" href="#" onclick="return doclink('link-100', 'get', 'link-44');">get</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L191"></a><tt class="py-lineno">191</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">viewSetup3</tt><tt class="py-op">.</tt><tt class="py-name">startButton</tt><tt class="py-op">.</tt><tt class="py-name">config</tt><tt class="py-op">(</tt><tt class="py-name">command</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-101" class="py-name" targets="Method tennisScore.Controller.startMatch()=tennisScore.Controller-class.html#startMatch"><a title="tennisScore.Controller.startMatch" class="py-name" href="#" onclick="return doclink('link-101', 'startMatch', 'link-101');">startMatch</a></tt><tt class="py-op">)</tt> </tt>
<a name="L192"></a><tt class="py-lineno">192</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">viewSetup2</tt><tt class="py-op">.</tt><tt class="py-name">destroy</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L193"></a><tt class="py-lineno">193</tt>  <tt class="py-line"> </tt>
<a name="Controller.reshowSetup3"></a><div id="Controller.reshowSetup3-def"><a name="L194"></a><tt class="py-lineno">194</tt> <a class="py-toggle" href="#" id="Controller.reshowSetup3-toggle" onclick="return toggle('Controller.reshowSetup3');">-</a><tt class="py-line">        <tt class="py-keyword">def</tt> <a class="py-def-name" href="tennisScore.Controller-class.html#reshowSetup3">reshowSetup3</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Controller.reshowSetup3-collapsed" style="display:none;" pad="+++" indent="++++++++++++"></div><div id="Controller.reshowSetup3-expanded"><a name="L195"></a><tt class="py-lineno">195</tt>  <tt class="py-line">                <tt class="py-docstring">"""Clears and reshows the third setup dialog."""</tt> </tt>
<a name="L196"></a><tt class="py-lineno">196</tt>  <tt class="py-line">                <tt class="py-comment"># Not used. I just leave original dialog open until the user gets it right.</tt> </tt>
<a name="L197"></a><tt class="py-lineno">197</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">viewSetup3</tt><tt class="py-op">.</tt><tt class="py-name">destroy</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L198"></a><tt class="py-lineno">198</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">viewSetup3</tt> <tt class="py-op">=</tt> <tt id="link-102" class="py-name"><a title="setup3.Setup3" class="py-name" href="#" onclick="return doclink('link-102', 'Setup3', 'link-11');">Setup3</a></tt><tt class="py-op">(</tt><tt class="py-name">root</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">mensMatch</tt><tt class="py-op">.</tt><tt id="link-103" class="py-name"><a title="observable.Observable.get" class="py-name" href="#" onclick="return doclink('link-103', 'get', 'link-44');">get</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">doublesMatch</tt><tt class="py-op">.</tt><tt id="link-104" class="py-name"><a title="observable.Observable.get" class="py-name" href="#" onclick="return doclink('link-104', 'get', 'link-44');">get</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L199"></a><tt class="py-lineno">199</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">viewSetup3</tt><tt class="py-op">.</tt><tt class="py-name">startButton</tt><tt class="py-op">.</tt><tt class="py-name">config</tt><tt class="py-op">(</tt><tt class="py-name">command</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-105" class="py-name"><a title="tennisScore.Controller.startMatch" class="py-name" href="#" onclick="return doclink('link-105', 'startMatch', 'link-101');">startMatch</a></tt><tt class="py-op">)</tt> </tt>
</div><a name="L200"></a><tt class="py-lineno">200</tt>  <tt class="py-line"> </tt>
<a name="Controller.startMatch"></a><div id="Controller.startMatch-def"><a name="L201"></a><tt class="py-lineno">201</tt> <a class="py-toggle" href="#" id="Controller.startMatch-toggle" onclick="return toggle('Controller.startMatch');">-</a><tt class="py-line">        <tt class="py-keyword">def</tt> <a class="py-def-name" href="tennisScore.Controller-class.html#startMatch">startMatch</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Controller.startMatch-collapsed" style="display:none;" pad="+++" indent="++++++++++++"></div><div id="Controller.startMatch-expanded"><a name="L202"></a><tt class="py-lineno">202</tt>  <tt class="py-line">                <tt class="py-docstring">"""Starts the match. Interprets third setup dialog. Player names, number of sets, ending tiebreak. Creates scoring buttons. Initializes scoreboard."""</tt> </tt>
<a name="L203"></a><tt class="py-lineno">203</tt>  <tt class="py-line">                <tt class="py-comment"># Get the strings for the two team's player names. Each string includes all object properties in parseable format.</tt> </tt>
<a name="L204"></a><tt class="py-lineno">204</tt>  <tt class="py-line">                <tt class="py-name">teamStrings</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">viewSetup3</tt><tt class="py-op">.</tt><tt id="link-106" class="py-name" targets="Method setup3.Setup3.getTeamStrings()=setup3.Setup3-class.html#getTeamStrings"><a title="setup3.Setup3.getTeamStrings" class="py-name" href="#" onclick="return doclink('link-106', 'getTeamStrings', 'link-106');">getTeamStrings</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L205"></a><tt class="py-lineno">205</tt>  <tt class="py-line">                <tt class="py-comment"># Doing next earlier than I'd normally do, so capture change of teams.</tt> </tt>
<a name="L206"></a><tt class="py-lineno">206</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scoreboard</tt> <tt class="py-op">=</tt> <tt id="link-107" class="py-name"><a title="tennisView.View" class="py-name" href="#" onclick="return doclink('link-107', 'View', 'link-5');">View</a></tt><tt class="py-op">(</tt><tt class="py-name">root</tt><tt class="py-op">)</tt>    <tt class="py-comment"># The main scoreboard</tt> </tt>
<a name="L207"></a><tt class="py-lineno">207</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">doublesMatch</tt><tt class="py-op">.</tt><tt id="link-108" class="py-name"><a title="observable.Observable.get" class="py-name" href="#" onclick="return doclink('link-108', 'get', 'link-44');">get</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L208"></a><tt class="py-lineno">208</tt>  <tt class="py-line">                        <tt class="py-name">props</tt> <tt class="py-op">=</tt> <tt id="link-109" class="py-name" targets="Function tennisScore.parsePlayerString()=tennisScore-module.html#parsePlayerString"><a title="tennisScore.parsePlayerString" class="py-name" href="#" onclick="return doclink('link-109', 'parsePlayerString', 'link-109');">parsePlayerString</a></tt><tt class="py-op">(</tt><tt class="py-name">teamStrings</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> <tt class="py-comment"># Parse string for first team, player 1, extract properties</tt> </tt>
<a name="L209"></a><tt class="py-lineno">209</tt>  <tt class="py-line">                        <tt class="py-name">player1</tt> <tt class="py-op">=</tt> <tt id="link-110" class="py-name"><a title="player" class="py-name" href="#" onclick="return doclink('link-110', 'player', 'link-16');">player</a></tt><tt class="py-op">.</tt><tt id="link-111" class="py-name" targets="Class player.Player=player.Player-class.html"><a title="player.Player" class="py-name" href="#" onclick="return doclink('link-111', 'Player', 'link-111');">Player</a></tt><tt class="py-op">(</tt><tt class="py-name">props</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">props</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">props</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">props</tt><tt class="py-op">[</tt><tt class="py-number">3</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L210"></a><tt class="py-lineno">210</tt>  <tt class="py-line">                        <tt class="py-name">props</tt> <tt class="py-op">=</tt> <tt id="link-112" class="py-name"><a title="tennisScore.parsePlayerString" class="py-name" href="#" onclick="return doclink('link-112', 'parsePlayerString', 'link-109');">parsePlayerString</a></tt><tt class="py-op">(</tt><tt class="py-name">teamStrings</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> <tt class="py-comment"># Parse string for first team, player 2, extract properties</tt> </tt>
<a name="L211"></a><tt class="py-lineno">211</tt>  <tt class="py-line">                        <tt class="py-name">player1a</tt> <tt class="py-op">=</tt> <tt id="link-113" class="py-name"><a title="player" class="py-name" href="#" onclick="return doclink('link-113', 'player', 'link-16');">player</a></tt><tt class="py-op">.</tt><tt id="link-114" class="py-name"><a title="player.Player" class="py-name" href="#" onclick="return doclink('link-114', 'Player', 'link-111');">Player</a></tt><tt class="py-op">(</tt><tt class="py-name">props</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">props</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">props</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">props</tt><tt class="py-op">[</tt><tt class="py-number">3</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L212"></a><tt class="py-lineno">212</tt>  <tt class="py-line">                        <tt class="py-name">props</tt> <tt class="py-op">=</tt> <tt id="link-115" class="py-name"><a title="tennisScore.parsePlayerString" class="py-name" href="#" onclick="return doclink('link-115', 'parsePlayerString', 'link-109');">parsePlayerString</a></tt><tt class="py-op">(</tt><tt class="py-name">teamStrings</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> <tt class="py-comment"># Parse string for second team, player 1, extract properties</tt> </tt>
<a name="L213"></a><tt class="py-lineno">213</tt>  <tt class="py-line">                        <tt class="py-name">player2</tt> <tt class="py-op">=</tt> <tt id="link-116" class="py-name"><a title="player" class="py-name" href="#" onclick="return doclink('link-116', 'player', 'link-16');">player</a></tt><tt class="py-op">.</tt><tt id="link-117" class="py-name"><a title="player.Player" class="py-name" href="#" onclick="return doclink('link-117', 'Player', 'link-111');">Player</a></tt><tt class="py-op">(</tt><tt class="py-name">props</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">props</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">props</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">props</tt><tt class="py-op">[</tt><tt class="py-number">3</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L214"></a><tt class="py-lineno">214</tt>  <tt class="py-line">                        <tt class="py-name">props</tt> <tt class="py-op">=</tt> <tt id="link-118" class="py-name"><a title="tennisScore.parsePlayerString" class="py-name" href="#" onclick="return doclink('link-118', 'parsePlayerString', 'link-109');">parsePlayerString</a></tt><tt class="py-op">(</tt><tt class="py-name">teamStrings</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> <tt class="py-comment"># Parse string for second team, player 2, extract properties</tt> </tt>
<a name="L215"></a><tt class="py-lineno">215</tt>  <tt class="py-line">                        <tt class="py-name">player2a</tt> <tt class="py-op">=</tt> <tt id="link-119" class="py-name"><a title="player" class="py-name" href="#" onclick="return doclink('link-119', 'player', 'link-16');">player</a></tt><tt class="py-op">.</tt><tt id="link-120" class="py-name"><a title="player.Player" class="py-name" href="#" onclick="return doclink('link-120', 'Player', 'link-111');">Player</a></tt><tt class="py-op">(</tt><tt class="py-name">props</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">props</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">props</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">props</tt><tt class="py-op">[</tt><tt class="py-number">3</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L216"></a><tt class="py-lineno">216</tt>  <tt class="py-line">                        <tt class="py-name">playerList</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-name">player1</tt><tt class="py-op">,</tt> <tt class="py-name">player1a</tt><tt class="py-op">,</tt> <tt class="py-name">player2</tt><tt class="py-op">,</tt> <tt class="py-name">player2a</tt><tt class="py-op">]</tt> <tt class="py-comment"># List used to check for player uniqueness</tt> </tt>
<a name="L217"></a><tt class="py-lineno">217</tt>  <tt class="py-line">                        <tt class="py-comment"># Set teams in model</tt> </tt>
<a name="L218"></a><tt class="py-lineno">218</tt>  <tt class="py-line">                        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">team</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt id="link-121" class="py-name"><a title="player" class="py-name" href="#" onclick="return doclink('link-121', 'player', 'link-16');">player</a></tt><tt class="py-op">.</tt><tt id="link-122" class="py-name" targets="Class player.Team=player.Team-class.html"><a title="player.Team" class="py-name" href="#" onclick="return doclink('link-122', 'Team', 'link-122');">Team</a></tt><tt class="py-op">(</tt><tt class="py-name">player1</tt><tt class="py-op">,</tt> <tt class="py-name">player1a</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt id="link-123" class="py-name"><a title="player" class="py-name" href="#" onclick="return doclink('link-123', 'player', 'link-16');">player</a></tt><tt class="py-op">.</tt><tt id="link-124" class="py-name"><a title="player.Team" class="py-name" href="#" onclick="return doclink('link-124', 'Team', 'link-122');">Team</a></tt><tt class="py-op">(</tt><tt class="py-name">player2</tt><tt class="py-op">,</tt> <tt class="py-name">player2a</tt><tt class="py-op">)</tt><tt class="py-op">]</tt> </tt>
<a name="L219"></a><tt class="py-lineno">219</tt>  <tt class="py-line">                <tt class="py-keyword">else</tt><tt class="py-op">:</tt> <tt class="py-comment"># singles match</tt> </tt>
<a name="L220"></a><tt class="py-lineno">220</tt>  <tt class="py-line">                        <tt class="py-name">props</tt> <tt class="py-op">=</tt> <tt id="link-125" class="py-name"><a title="tennisScore.parsePlayerString" class="py-name" href="#" onclick="return doclink('link-125', 'parsePlayerString', 'link-109');">parsePlayerString</a></tt><tt class="py-op">(</tt><tt class="py-name">teamStrings</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> <tt class="py-comment"># Parse string for first player, extract properties</tt> </tt>
<a name="L221"></a><tt class="py-lineno">221</tt>  <tt class="py-line">                        <tt class="py-name">player1</tt> <tt class="py-op">=</tt> <tt id="link-126" class="py-name"><a title="player" class="py-name" href="#" onclick="return doclink('link-126', 'player', 'link-16');">player</a></tt><tt class="py-op">.</tt><tt id="link-127" class="py-name"><a title="player.Player" class="py-name" href="#" onclick="return doclink('link-127', 'Player', 'link-111');">Player</a></tt><tt class="py-op">(</tt><tt class="py-name">props</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">props</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">props</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">props</tt><tt class="py-op">[</tt><tt class="py-number">3</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L222"></a><tt class="py-lineno">222</tt>  <tt class="py-line">                        <tt class="py-name">props</tt> <tt class="py-op">=</tt> <tt id="link-128" class="py-name"><a title="tennisScore.parsePlayerString" class="py-name" href="#" onclick="return doclink('link-128', 'parsePlayerString', 'link-109');">parsePlayerString</a></tt><tt class="py-op">(</tt><tt class="py-name">teamStrings</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> <tt class="py-comment"># Parse string for second, extract properties</tt> </tt>
<a name="L223"></a><tt class="py-lineno">223</tt>  <tt class="py-line">                        <tt class="py-name">player2</tt> <tt class="py-op">=</tt> <tt id="link-129" class="py-name"><a title="player" class="py-name" href="#" onclick="return doclink('link-129', 'player', 'link-16');">player</a></tt><tt class="py-op">.</tt><tt id="link-130" class="py-name"><a title="player.Player" class="py-name" href="#" onclick="return doclink('link-130', 'Player', 'link-111');">Player</a></tt><tt class="py-op">(</tt><tt class="py-name">props</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">props</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">props</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">props</tt><tt class="py-op">[</tt><tt class="py-number">3</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L224"></a><tt class="py-lineno">224</tt>  <tt class="py-line">                        <tt class="py-name">playerList</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-name">player1</tt><tt class="py-op">,</tt> <tt class="py-name">player2</tt><tt class="py-op">]</tt> <tt class="py-comment"># List used to check for player uniqueness</tt> </tt>
<a name="L225"></a><tt class="py-lineno">225</tt>  <tt class="py-line">                        <tt class="py-comment"># Set teams in model</tt> </tt>
<a name="L226"></a><tt class="py-lineno">226</tt>  <tt class="py-line">                        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">team</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt id="link-131" class="py-name"><a title="player" class="py-name" href="#" onclick="return doclink('link-131', 'player', 'link-16');">player</a></tt><tt class="py-op">.</tt><tt id="link-132" class="py-name"><a title="player.Team" class="py-name" href="#" onclick="return doclink('link-132', 'Team', 'link-122');">Team</a></tt><tt class="py-op">(</tt><tt class="py-name">player1</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt id="link-133" class="py-name"><a title="player" class="py-name" href="#" onclick="return doclink('link-133', 'player', 'link-16');">player</a></tt><tt class="py-op">.</tt><tt id="link-134" class="py-name"><a title="player.Team" class="py-name" href="#" onclick="return doclink('link-134', 'Team', 'link-122');">Team</a></tt><tt class="py-op">(</tt><tt class="py-name">player2</tt><tt class="py-op">)</tt><tt class="py-op">]</tt> </tt>
<a name="L227"></a><tt class="py-lineno">227</tt>  <tt class="py-line"> </tt>
<a name="L228"></a><tt class="py-lineno">228</tt>  <tt class="py-line">                <tt class="py-comment"># Check for player uniqueness. If not, then re-show dialog.</tt> </tt>
<a name="L229"></a><tt class="py-lineno">229</tt>  <tt class="py-line">                <tt class="py-comment"># Recall that when form a set from a list, any duplicate items will be discarded</tt> </tt>
<a name="L230"></a><tt class="py-lineno">230</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">playerList</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt id="link-135" class="py-name"><a title="observable.Observable.set" class="py-name" href="#" onclick="return doclink('link-135', 'set', 'link-74');">set</a></tt><tt class="py-op">(</tt><tt class="py-name">playerList</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L231"></a><tt class="py-lineno">231</tt>  <tt class="py-line">                        <tt class="py-comment"># There are duplicates, so warn, and retry</tt> </tt>
<a name="L232"></a><tt class="py-lineno">232</tt>  <tt class="py-line">                        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">view4</tt> <tt class="py-op">=</tt> <tt id="link-136" class="py-name"><a title="playerError.PlayerError" class="py-name" href="#" onclick="return doclink('link-136', 'PlayerError', 'link-13');">PlayerError</a></tt><tt class="py-op">(</tt><tt class="py-name">root</tt><tt class="py-op">)</tt> </tt>
<a name="L233"></a><tt class="py-lineno">233</tt>  <tt class="py-line">                        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">view4</tt><tt class="py-op">.</tt><tt class="py-name">okButton</tt><tt class="py-op">.</tt><tt class="py-name">config</tt><tt class="py-op">(</tt><tt class="py-name">command</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">view4</tt><tt class="py-op">.</tt><tt class="py-name">destroy</tt><tt class="py-op">)</tt> </tt>
<a name="L234"></a><tt class="py-lineno">234</tt>  <tt class="py-line">                        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scoreboard</tt><tt class="py-op">.</tt><tt class="py-name">destroy</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L235"></a><tt class="py-lineno">235</tt>  <tt class="py-line">                        <tt class="py-comment"># Once drop out of view4 dialog, will be back at third setup dialog to allow user to correct error.</tt> </tt>
<a name="L236"></a><tt class="py-lineno">236</tt>  <tt class="py-line">                        <tt class="py-keyword">return</tt> <tt class="py-comment"># Not sure this is necessary. Likely never gets here.</tt> </tt>
<a name="L237"></a><tt class="py-lineno">237</tt>  <tt class="py-line"> </tt>
<a name="L238"></a><tt class="py-lineno">238</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">duplicateLastName</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">viewSetup3</tt><tt class="py-op">.</tt><tt class="py-name">duplicateLastName</tt> <tt class="py-comment"># List of last names that appear mroe than once.</tt> </tt>
<a name="L239"></a><tt class="py-lineno">239</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt id="link-137" class="py-name"><a title="tennisScore.specialCaseNames" class="py-name" href="#" onclick="return doclink('link-137', 'specialCaseNames', 'link-19');">specialCaseNames</a></tt> <tt class="py-op">=</tt> <tt id="link-138" class="py-name"><a title="tennisScore.specialCaseNames" class="py-name" href="#" onclick="return doclink('link-138', 'specialCaseNames', 'link-19');">specialCaseNames</a></tt> <tt class="py-comment"># List of special case names, same last name AND first initial.</tt> </tt>
<a name="L240"></a><tt class="py-lineno">240</tt>  <tt class="py-line"> </tt>
<a name="L241"></a><tt class="py-lineno">241</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">numberOfSets</tt><tt class="py-op">.</tt><tt id="link-139" class="py-name"><a title="observable.Observable.set" class="py-name" href="#" onclick="return doclink('link-139', 'set', 'link-74');">set</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">viewSetup3</tt><tt class="py-op">.</tt><tt id="link-140" class="py-name" targets="Method setup3.Setup3.getNumberOfSets()=setup3.Setup3-class.html#getNumberOfSets"><a title="setup3.Setup3.getNumberOfSets" class="py-name" href="#" onclick="return doclink('link-140', 'getNumberOfSets', 'link-140');">getNumberOfSets</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L242"></a><tt class="py-lineno">242</tt>  <tt class="py-line">                <tt class="py-comment"># Following could be more general. It works for three and five set matches. Which is everthing, I think. Later version.</tt> </tt>
<a name="L243"></a><tt class="py-lineno">243</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">numberOfSets</tt><tt class="py-op">.</tt><tt id="link-141" class="py-name"><a title="observable.Observable.get" class="py-name" href="#" onclick="return doclink('link-141', 'get', 'link-44');">get</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-number">3</tt><tt class="py-op">:</tt> </tt>
<a name="L244"></a><tt class="py-lineno">244</tt>  <tt class="py-line">                        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">winSets</tt><tt class="py-op">.</tt><tt id="link-142" class="py-name"><a title="observable.Observable.set" class="py-name" href="#" onclick="return doclink('link-142', 'set', 'link-74');">set</a></tt><tt class="py-op">(</tt><tt class="py-number">2</tt><tt class="py-op">)</tt> </tt>
<a name="L245"></a><tt class="py-lineno">245</tt>  <tt class="py-line">                <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L246"></a><tt class="py-lineno">246</tt>  <tt class="py-line">                        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">winSets</tt><tt class="py-op">.</tt><tt id="link-143" class="py-name"><a title="observable.Observable.set" class="py-name" href="#" onclick="return doclink('link-143', 'set', 'link-74');">set</a></tt><tt class="py-op">(</tt><tt class="py-number">3</tt><tt class="py-op">)</tt> </tt>
<a name="L247"></a><tt class="py-lineno">247</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">doublesMatch</tt><tt class="py-op">.</tt><tt id="link-144" class="py-name"><a title="observable.Observable.get" class="py-name" href="#" onclick="return doclink('link-144', 'get', 'link-44');">get</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L248"></a><tt class="py-lineno">248</tt>  <tt class="py-line">                        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">winSets</tt><tt class="py-op">.</tt><tt id="link-145" class="py-name"><a title="observable.Observable.set" class="py-name" href="#" onclick="return doclink('link-145', 'set', 'link-74');">set</a></tt><tt class="py-op">(</tt><tt class="py-number">2</tt><tt class="py-op">)</tt> </tt>
<a name="L249"></a><tt class="py-lineno">249</tt>  <tt class="py-line"> </tt>
<a name="L250"></a><tt class="py-lineno">250</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt id="link-146" class="py-name"><a title="tennisModel.DEBUG
tennisScore.DEBUG
tennisView.DEBUG" class="py-name" href="#" onclick="return doclink('link-146', 'DEBUG', 'link-18');">DEBUG</a></tt><tt class="py-op">:</tt> </tt>
<a name="L251"></a><tt class="py-lineno">251</tt>  <tt class="py-line">                        <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">noEndingTiebreak</tt><tt class="py-op">.</tt><tt id="link-147" class="py-name"><a title="observable.Observable.get" class="py-name" href="#" onclick="return doclink('link-147', 'get', 'link-44');">get</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L252"></a><tt class="py-lineno">252</tt>  <tt class="py-line">                                <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-string">"This match cannot end set {} in a tiebreak."</tt><tt class="py-op">.</tt><tt class="py-name">format</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">numberOfSets</tt><tt class="py-op">.</tt><tt id="link-148" class="py-name"><a title="observable.Observable.get" class="py-name" href="#" onclick="return doclink('link-148', 'get', 'link-44');">get</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L253"></a><tt class="py-lineno">253</tt>  <tt class="py-line">                        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L254"></a><tt class="py-lineno">254</tt>  <tt class="py-line">                                <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-string">"This match can end set {} in a tiebreak."</tt><tt class="py-op">.</tt><tt class="py-name">format</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">numberOfSets</tt><tt class="py-op">.</tt><tt id="link-149" class="py-name"><a title="observable.Observable.get" class="py-name" href="#" onclick="return doclink('link-149', 'get', 'link-44');">get</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L255"></a><tt class="py-lineno">255</tt>  <tt class="py-line"> </tt>
<a name="L256"></a><tt class="py-lineno">256</tt>  <tt class="py-line">                <tt id="link-150" class="py-name"><a title="util" class="py-name" href="#" onclick="return doclink('link-150', 'util', 'link-17');">util</a></tt><tt class="py-op">.</tt><tt id="link-151" class="py-name"><a title="util.dbgprint" class="py-name" href="#" onclick="return doclink('link-151', 'dbgprint', 'link-40');">dbgprint</a></tt><tt class="py-op">(</tt><tt id="link-152" class="py-name"><a title="tennisModel.DEBUG
tennisScore.DEBUG
tennisView.DEBUG" class="py-name" href="#" onclick="return doclink('link-152', 'DEBUG', 'link-18');">DEBUG</a></tt><tt class="py-op">,</tt> <tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">winSets</tt><tt class="py-op">.</tt><tt id="link-153" class="py-name"><a title="observable.Observable.get" class="py-name" href="#" onclick="return doclink('link-153', 'get', 'link-44');">get</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">+</tt><tt class="py-string">" sets to win match."</tt><tt class="py-op">)</tt> </tt>
<a name="L257"></a><tt class="py-lineno">257</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">viewSetup3</tt><tt class="py-op">.</tt><tt class="py-name">destroy</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L258"></a><tt class="py-lineno">258</tt>  <tt class="py-line">                <tt class="py-comment"># Establish the team scoring buttons.</tt> </tt>
<a name="L259"></a><tt class="py-lineno">259</tt>  <tt class="py-line">                <tt class="py-comment"># Q: Should this be done in teamChanged? It works fine here, but may make more sense there.</tt> </tt>
<a name="L260"></a><tt class="py-lineno">260</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scoringView</tt> <tt class="py-op">=</tt> <tt id="link-154" class="py-name"><a title="scoring.Scoring" class="py-name" href="#" onclick="return doclink('link-154', 'Scoring', 'link-15');">Scoring</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scoreboard</tt><tt class="py-op">,</tt> </tt>
<a name="L261"></a><tt class="py-lineno">261</tt>  <tt class="py-line">                                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">team</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-155" class="py-name" targets="Method player.Player.buttonName()=player.Player-class.html#buttonName,Method player.Team.buttonName()=player.Team-class.html#buttonName"><a title="player.Player.buttonName
player.Team.buttonName" class="py-name" href="#" onclick="return doclink('link-155', 'buttonName', 'link-155');">buttonName</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">duplicateLastName</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt id="link-156" class="py-name"><a title="tennisScore.specialCaseNames" class="py-name" href="#" onclick="return doclink('link-156', 'specialCaseNames', 'link-19');">specialCaseNames</a></tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L262"></a><tt class="py-lineno">262</tt>  <tt class="py-line">                                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">team</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-157" class="py-name"><a title="player.Player.buttonName
player.Team.buttonName" class="py-name" href="#" onclick="return doclink('link-157', 'buttonName', 'link-155');">buttonName</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">duplicateLastName</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt id="link-158" class="py-name"><a title="tennisScore.specialCaseNames" class="py-name" href="#" onclick="return doclink('link-158', 'specialCaseNames', 'link-19');">specialCaseNames</a></tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L263"></a><tt class="py-lineno">263</tt>  <tt class="py-line">                                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">doublesMatch</tt><tt class="py-op">.</tt><tt id="link-159" class="py-name"><a title="observable.Observable.get" class="py-name" href="#" onclick="return doclink('link-159', 'get', 'link-44');">get</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt>   <tt class="py-comment"># The scoring buttons</tt> </tt>
<a name="L264"></a><tt class="py-lineno">264</tt>  <tt class="py-line">                <tt class="py-comment"># Pick starting server at random</tt> </tt>
<a name="L265"></a><tt class="py-lineno">265</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">server</tt><tt class="py-op">.</tt><tt id="link-160" class="py-name"><a title="observable.Observable.set" class="py-name" href="#" onclick="return doclink('link-160', 'set', 'link-74');">set</a></tt><tt class="py-op">(</tt><tt class="py-name">randrange</tt><tt class="py-op">(</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L266"></a><tt class="py-lineno">266</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scoringView</tt><tt class="py-op">.</tt><tt class="py-name">team1Button</tt><tt class="py-op">.</tt><tt class="py-name">config</tt><tt class="py-op">(</tt><tt class="py-name">command</tt><tt class="py-op">=</tt><tt class="py-keyword">lambda</tt><tt class="py-op">:</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-161" class="py-name"><a title="tennisModel.Model.incrementGameScore
tennisScore.Controller.incrementGameScore" class="py-name" href="#" onclick="return doclink('link-161', 'incrementGameScore', 'link-73');">incrementGameScore</a></tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">)</tt>   <tt class="py-comment"># Team 1 scores</tt> </tt>
<a name="L267"></a><tt class="py-lineno">267</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">scoringView</tt><tt class="py-op">.</tt><tt class="py-name">team2Button</tt><tt class="py-op">.</tt><tt class="py-name">config</tt><tt class="py-op">(</tt><tt class="py-name">command</tt><tt class="py-op">=</tt><tt class="py-keyword">lambda</tt><tt class="py-op">:</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-162" class="py-name"><a title="tennisModel.Model.incrementGameScore
tennisScore.Controller.incrementGameScore" class="py-name" href="#" onclick="return doclink('link-162', 'incrementGameScore', 'link-73');">incrementGameScore</a></tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">)</tt>   <tt class="py-comment"># Team 2 scores</tt> </tt>
<a name="L268"></a><tt class="py-lineno">268</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt id="link-163" class="py-name"><a title="tennisModel.DEBUG
tennisScore.DEBUG
tennisView.DEBUG" class="py-name" href="#" onclick="return doclink('link-163', 'DEBUG', 'link-18');">DEBUG</a></tt><tt class="py-op">:</tt> </tt>
<a name="L269"></a><tt class="py-lineno">269</tt>  <tt class="py-line">                        <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-string">"Before initTennisView(), self.model.team is {}"</tt><tt class="py-op">.</tt><tt class="py-name">format</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">model</tt><tt class="py-op">.</tt><tt class="py-name">team</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L270"></a><tt class="py-lineno">270</tt>  <tt class="py-line">                <tt class="py-comment"># Initialize scoreboard view, and we are off and running.</tt> </tt>
<a name="L271"></a><tt class="py-lineno">271</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-164" class="py-name" targets="Method tennisScore.Controller.initTennisView()=tennisScore.Controller-class.html#initTennisView"><a title="tennisScore.Controller.initTennisView" class="py-name" href="#" onclick="return doclink('link-164', 'initTennisView', 'link-164');">initTennisView</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L272"></a><tt class="py-lineno">272</tt>  <tt class="py-line"> </tt>
<a name="parsePlayerString"></a><div id="parsePlayerString-def"><a name="L273"></a><tt class="py-lineno">273</tt> <a class="py-toggle" href="#" id="parsePlayerString-toggle" onclick="return toggle('parsePlayerString');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="tennisScore-module.html#parsePlayerString">parsePlayerString</a><tt class="py-op">(</tt><tt class="py-param">s</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="parsePlayerString-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="parsePlayerString-expanded"><a name="L274"></a><tt class="py-lineno">274</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L275"></a><tt class="py-lineno">275</tt>  <tt class="py-line"><tt class="py-docstring">        Parses a string representing a player into elements of a Player object.</tt> </tt>
<a name="L276"></a><tt class="py-lineno">276</tt>  <tt class="py-line"><tt class="py-docstring">        @type s: string</tt> </tt>
<a name="L277"></a><tt class="py-lineno">277</tt>  <tt class="py-line"><tt class="py-docstring">        @param s: String representing a player.</tt> </tt>
<a name="L278"></a><tt class="py-lineno">278</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype: tuple</tt> </tt>
<a name="L279"></a><tt class="py-lineno">279</tt>  <tt class="py-line"><tt class="py-docstring">        @return: Elements of a Player object.</tt> </tt>
<a name="L280"></a><tt class="py-lineno">280</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L281"></a><tt class="py-lineno">281</tt>  <tt class="py-line">        <tt class="py-name">l1</tt> <tt class="py-op">=</tt> <tt class="py-name">s</tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-string">'.'</tt><tt class="py-op">)</tt> </tt>
<a name="L282"></a><tt class="py-lineno">282</tt>  <tt class="py-line">        <tt class="py-name">rank</tt> <tt class="py-op">=</tt> <tt class="py-name">l1</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L283"></a><tt class="py-lineno">283</tt>  <tt class="py-line">        <tt class="py-name">l2</tt> <tt class="py-op">=</tt> <tt class="py-name">l1</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-string">','</tt><tt class="py-op">)</tt> </tt>
<a name="L284"></a><tt class="py-lineno">284</tt>  <tt class="py-line">        <tt class="py-name">lastName</tt> <tt class="py-op">=</tt> <tt class="py-name">l2</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt class="py-name">strip</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L285"></a><tt class="py-lineno">285</tt>  <tt class="py-line">        <tt class="py-name">l3</tt> <tt class="py-op">=</tt> <tt class="py-name">l2</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-string">'('</tt><tt class="py-op">)</tt> </tt>
<a name="L286"></a><tt class="py-lineno">286</tt>  <tt class="py-line">        <tt class="py-name">firstName</tt> <tt class="py-op">=</tt> <tt class="py-name">l3</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt class="py-name">strip</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L287"></a><tt class="py-lineno">287</tt>  <tt class="py-line">        <tt class="py-name">country</tt> <tt class="py-op">=</tt> <tt class="py-name">l3</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">:</tt><tt class="py-number">3</tt><tt class="py-op">]</tt> <tt class="py-comment"># Three-letter IOC code for country.</tt> </tt>
<a name="L288"></a><tt class="py-lineno">288</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-op">(</tt><tt class="py-name">rank</tt><tt class="py-op">,</tt> <tt class="py-name">firstName</tt><tt class="py-op">,</tt> <tt class="py-name">lastName</tt><tt class="py-op">,</tt> <tt class="py-name">country</tt><tt class="py-op">)</tt> </tt>
</div><a name="L289"></a><tt class="py-lineno">289</tt>  <tt class="py-line"> </tt>
<a name="L290"></a><tt class="py-lineno">290</tt>  <tt class="py-line"><tt class="py-keyword">if</tt> <tt class="py-name">__name__</tt> <tt class="py-op">==</tt> <tt class="py-string">'__main__'</tt><tt class="py-op">:</tt> </tt>
<a name="L291"></a><tt class="py-lineno">291</tt>  <tt class="py-line">        <tt class="py-name">root</tt> <tt class="py-op">=</tt> <tt class="py-name">tk</tt><tt class="py-op">.</tt><tt class="py-name">Tk</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L292"></a><tt class="py-lineno">292</tt>  <tt class="py-line">        <tt class="py-name">root</tt><tt class="py-op">.</tt><tt class="py-name">withdraw</tt><tt class="py-op">(</tt><tt class="py-op">)</tt>   <tt class="py-comment"># removes widget from screen</tt> </tt>
<a name="L293"></a><tt class="py-lineno">293</tt>  <tt class="py-line">        <tt class="py-name">app</tt> <tt class="py-op">=</tt> <tt id="link-165" class="py-name" targets="Class tennisScore.Controller=tennisScore.Controller-class.html"><a title="tennisScore.Controller" class="py-name" href="#" onclick="return doclink('link-165', 'Controller', 'link-165');">Controller</a></tt><tt class="py-op">(</tt><tt class="py-name">root</tt><tt class="py-op">)</tt> </tt>
<a name="L294"></a><tt class="py-lineno">294</tt>  <tt class="py-line">        <tt class="py-name">root</tt><tt class="py-op">.</tt><tt class="py-name">mainloop</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L295"></a><tt class="py-lineno">295</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th bgcolor="#70b0f0" class="navbar-select"
          >&nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            >tennisScore</th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Sun Nov  9 17:23:06 2014
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
